package jzOffer;

/**
 * @author 郝文雪
 * @date 2022/7/18 16:02
 * @Description 数组中重复的数字
 */
public class JZ3 {
    public int duplicate (int[] numbers) {
        // write code here
        int n=numbers.length;
        int[] arr=new int[n];
        for(int i=0;i<numbers.length;i++){
            if(arr[numbers[i]]>0){
                return numbers[i];
            }
            arr[numbers[i]]++;
        }
        return -1;
    }
}
